﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;

namespace IHISCETeim.Web.MachineSys
{
    public partial class SAPItemListLookUp : PageBase
    {
        #region 属性 (查询条件)
        protected string target
        {
            get
            {
                return GetRequestValue<string>("target", "");
            }
        }
        protected string rel
        {
            get
            {
                return GetRequestValue<string>("rel", "");
            }
        }
        protected override string orderField
        {
            get
            {
                return string.IsNullOrEmpty(base.orderField) ? "ItemName" : base.orderField;
            }
        }
        protected override string orderDirection
        {
            get
            {
                return string.IsNullOrEmpty(base.orderDirection) ? "Asc" : base.orderDirection;
            }
        }

        protected string ItemName
        {
            get
            {
                return GetRequestValue<string>("ItemName", "");

            }
        }

        protected string itmsGrpCod
        {
            get
            {
                return GetRequestValue<string>("itmsGrpCod", "102");

            }
        }
        protected string inputtag
        {
            get {
                return GetRequestValue<string>("inputtag", "");
            }
        }
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            DataBind();
        }

        protected void DataBind()
        {
            string showtype = GetRequestValue<string>("itmsGrpCod", "102");
            DataTable dt = null;
            
            if (showtype == "101")
            {
                dt = SBOController.GetYanCaiLiaoOITM(ItemName, 40);
            }
            if (showtype == "102")
            {
                dt = SBOController.GetPaiJinOITMList(ItemName, 40);
            }


            //if (dt == null)
            //    return ;

            this.rpMenu.DataSource = dt;
            this.rpMenu.DataBind();

            

        }

        protected override string DWZRef
        {
            get { return ""; }
        }

       
    }
}